<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!-- 引入一个JSP的标签  JSTL-->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
	<%-- <h1>恭喜，spring mvc框架配置成功</h1>
	接收到后台传递的用户信息是：
	</br> 用户名：${user.username}
	</br> 地址：${user.address }
	</br> --%>
	
	
	<table style="border: 2px solid #eee;">
		<tr>
			<th>用户名</th>
			<th>性别</th>
			<th>生日</th>
			<th>地址</th>
		</tr>
		<c:forEach items="${users}" var="user">
		<tr>
			<td>${user.username}</td>
			<!--  三目运算符： 1 > 2 ? 1 : 2 -->
			<td>${user.sex == 1 ? '男':'女' }</td>
			<c:if test="${user.birthday == null}">
				<td></td>
			</c:if>
			<c:if test="${user.birthday != null}">
				<td><fmt:formatDate value="${user.birthday }" pattern="yyyy-MM-dd"/> </td>
			</c:if>
			<td>${user.address }</td>
		</tr>
		</c:forEach>
	</table>
</body>
</html>